<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/public.css" media="all">
</head>
<body>
<div class="layui-form layuimini-form" lay-filter="formTest" >
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="hidden" name="id"   value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">姓名</label>
        <div class="layui-input-block">
            <input type="text" name="" id="name" readonly value="" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label required">部门</label>
        <div class="layui-input-block">
            <input type="" name="" id="department" readonly value="" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label required">职业</label>
        <div class="layui-input-block">
            <input type="" name="" id="job" value="" readonly class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label required">等级</label>
        <div class="layui-input-block">
            <input type="" name="" id="grade" value="" readonly class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label required">工资</label>
        <div class="layui-input-block">
            <input type="number" name="" readonly id="total_wages" value="" class="layui-input">
        </div>
    </div>


</div>
</div>
<script src="/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form', 'table'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table;

            var data = JSON.parse(localStorage.getItem("employee"));

            var id = data.id;
            console.log(id)
        $.get("/employee/selectById.do?id="+id, function (res) {
            if (res.code == 200) {
                $("#name").val(res.data.name)
                $("#job").val(res.data.job_name)
                $("#department").val(res.data.department_name)
                $("#grade").val(res.data.grade_name)
                $("#total_wages").val(res.data.total_wages)
            }
        })

    });
</script>

</body>
</html>